package com.gzq.learn.springbootdemo.rabbitmq;

import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.gzq.learn.springbootdemo.domain.UserDTO;

@Component
public class UserSender {

    @Autowired
    private AmqpTemplate amqpTemplate;

    public void send() {
        UserDTO userDTO = new UserDTO("userName", "email", "nickName", "password",
                "regTime");
        amqpTemplate.convertAndSend("object", userDTO);
    }

}
